<<!include:header>>
    <!-- ======= Hero Section344 ======= -->
    <section class="hero-section" style="height:50vh;min-height:200px" id="hero">

        <div class="wave">

            <svg width="100%" height="355px" viewBox="0 0 1920 355" version="1.1" xmlns="http://www.w3.org/2000/svg"
                xmlns:xlink="http://www.w3.org/1999/xlink">
                <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
                    <g id="Apple-TV" transform="translate(0.000000, -402.000000)" fill="#FFFFFF">
                        <path
                            d="M0,439.134243 C175.04074,464.89273 327.944386,477.771974 458.710937,477.771974 C654.860765,477.771974 870.645295,442.632362 1205.9828,410.192501 C1429.54114,388.565926 1667.54687,411.092417 1920,477.771974 L1920,757 L1017.15166,757 L0,757 L0,439.134243 Z"
                            id="Path"></path>
                    </g>
                </g>
            </svg>
        </div>

        <div class="container">
            <div class="row align-items-center" style="height:50vh;min-height:200px">
                <div class="col-12 hero-text-image">
                    <div class="row">
                        <div class="col-lg-1 text-center text-lg-left"> </div>
                        <div class="col-lg-6 text-center text-lg-left">
                            <h1 data-aos="fade-right" id="newsKindHead">聚焦行业资讯</h1>
                            <p class="mb-5" data-aos="fade-right" data-aos-delay="100" id="newKindDetail">分享教学经验</p>

                        </div>
                        <div class="col-lg-5 iphone-wrap" id="newsKindImg">
                            <img src="/upload/1/platform/2020-07-20/newsCenter.png" alt="Image" data-aos="fade-right">

                        </div>
                    </div>
                </div>
            </div>
        </div>

    </section><!-- End Hero -->

    <main id="main">
        <!-- ======= Testimonials Section ======= -->
        <div class=" container ">
            <div class="row " id="courseDiv" style="min-height: 500px;padding:10px">
                <div class=" col-xs-12 col-sm-12 col-md-8 col-lg-9" id="newsList">

                </div>
                <div class="  col-xs-12 col-sm-12 col-md-4 col-lg-3" id="newsPanel">

                </div>
            </div>
        </div>
        <div class="container">
            <div class="row center-block">
                <nav aria-label="Page navigation">
                    <ul class="pagination pagination-lg" id="pageDiv">

                    </ul>
                </nav>
            </div>
        </div>

        <!-- End Testimonials Section -->
        <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.20.0-0/axios.min.js"></script>
        <script>
            var totalNum = 0;
            var currentPage = 1;//当前页
            var pageStep = 10;// 每页显示多少条

            var kind = 0;

            var query = window.location.search.substring(1);
            var vars = query.split("&");
            for (var i = 0; i < vars.length; i++) {
                var pair = vars[i].split("=");
                if (pair[0] == "kind") {
                    kind = pair[1];
                    break;
                }
            }
            if (kind == 3) {

                document.getElementById("newsKindHead").innerHTML = "竞赛活动";
                document.getElementById("newKindDetail").innerHTML = "喜欢哪个活动就在旁边报名吧";
                document.getElementById("newsKindImg").innerHTML = "";

            }

            axios.get('/api/news/getPlatformNews/0?kind=' + kind)
                .then(function (response) {
                    var res = response.data;
                    if (res.code != 200) {

                        alert(res.title)
                        return;
                    }
                    var newsStr = "";
                    for (var i = 0; i < res.data.length; i++) {
                        var newsItem = res.data[i];
                        newsStr += ` <div class="media" style="margin:50px">
                    <div class="media-left">
                        <img class="media-object" style="max-width:70px;max-height:70px;" src="`+ newsItem.icon + `" alt="...">
                    </div>
                    <div class="media-body" style="margin-left: 25px;">
                        <a href="/newsDetail?id=`+ newsItem.Id + `">
                            <h4 class="media-heading">`+ newsItem.Title + `</h4>
                        </a>
                        `+ newsItem.Description + `
                    </div>
                </div>`;

                    }

                    document.getElementById("newsList").innerHTML = newsStr;

                    totalNum = res.title;
                    //------- 翻页
                    var pageStr = `<li style="margin:20px;cursor:pointer;">
                        <div  onclick ="prePage()""  aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span>
                        </div>
                    </li>`;
                    for (var i = 0; i < Math.ceil(totalNum / pageStep); i++) {
                        if ((i + 1) == currentPage) {
                            pageStr += `<li  style="margin:20px;"> ` + (i + 1) + ` </li>`;
                        } else {
                            pageStr += `<li style="margin:20px;cursor:pointer;"><span onclick="search(` + (i + 1) + `)">` + (i + 1) + `</a></li>`;

                        }
                    }
                    pageStr += `<li style="margin:20px;cursor:pointer;">
                        <div  onclick ="nextPage()"" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </div>
                    </li>`;
                    document.getElementById("pageDiv").innerHTML = pageStr;


                })
                .catch(function (error) {
                    console.log(error);
                });


        </script>
    </main><!-- End #main -->
    <<!include:footer>>